<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
    <script type="text/javascript">
        //			typeof() number string boolean object undefined function;
        //undefined undefined
        //null object
        //NaN  number
        //			var num = NaN;
        //			console.log(typeof(num));

        //			var num = 1 + "2";
        //			console.log(num);//12

        //
        //			var num = 1 - "2";
        //			console.log(num);//-1

        //Number
        /**
        var num = Number("123.a");
        console.log(typeof(num));//number
        console.log(num);//NaN
        var num = Number(null);
        console.log(num);//0
        var num = Number(undefined);
        console.log(num);//NaN
        var num = Number("a");
        console.log(num);//NaN
        var num = Number("-123dad");
        console.log(num);//NaN
        var num = Number(true);
        console.log(num);//1
        */


        //ParseInt()

        /**
        var num = parseInt("123");
        console.log(num);//123
        */


        //ParseInt(string,进制)    进制-->10进制    2-36

        /**
        var num = parseInt("3",2);
        console.log(num);//NaN
        var num = parseInt(true);
        console.log(num);//NaN
        var num = parseInt("123dvss");
        console.log(num);//123
        var num = parseInt("100px");
        console.log(num);//100
        var num = parseInt("100.px");
        console.log(num);//100
        */

        //parseFloat();//除了第一个点的非数字类截至，只有一个参数


        //string
        /**
        var str = String(123);
        console.log(typeof(str) + ":" + str);//string:123

        var str = String(undefined);
        console.log(str);//undefined

        var str = String(null);
        console.log(str);//null

        var str = String(NaN);
        console.log(str);//NaN
        */

        //Boolean
        /**
        var boo = Boolean(1);
        console.log(boo);//true
        var boo = Boolean(undefined);
        console.log(boo);//false
        var boo = Boolean(null);
        console.log(boo);//false
        var boo = Boolean(NaN);
        console.log(boo);//false
        var boo = Boolean("11");
        console.log(boo);//true
        var boo = Boolean(function e(){});
        console.log(boo);//true
        */
        //toString()
        /**
        var num = 10101011101001;
        var test = parseInt(num,2);//2进制-->10
        console.log(test.toString(16));//10-->16
        var demo = 20;
        var num = demo.toString(8);//8代表进制
        console.log(num);//24
        var demo = null;
        var num = demo.toString();//Cannot read property 'toString' of null
        var demo1 = undefined;
        var num1 = demo.toString();//Cannot read property 'toString' of undefined
        */
        //隐式类型转换
        //isNan()	isNaN-->Number(123)

        /**
        console.log(isNaN(123));//false
        console.log(isNaN("123"));//false
        console.log(isNaN("abc"));//true
        console.log(isNaN(null));//false Number(null)-->0
        console.log(isNaN(undefined));//true
        console.log(isNaN(NaN));//true
        */
        //++/--	-/+   ++/--/- -->Number    +-->string
        /**
        var a = "123";
        a++;//a =124
        var b = "abc";
        b++;//a =NaN
        */
        //&&/||/!   -->   数字优先

        // == 

        //特殊   大于小于
        /**
        undefined > 0
        undefined < 0
        undefined == 0
			
        null > 0
        null < 0
        null = 0
        //全部为false
        undefined == null
			
        NaN == NaN
        */

        //=== !==  不发生类型转换

        /*
        a = 123;
        console.log(a);//123
        console.log(typeof(typeof(b)));//string
        */
       
       var a = 'aaa';
       var b = 'aaa';
       console.log(a == b);
    </script>

</body>

</html>